{{ define "main" }}
  <article class="flex flex-col items-center justify-center h-full mt-10 text-center">
    <header class="flex flex-col items-center mb-3">
      {{ with .Site.Author.image }}
        {{ $src := . }}
        {{ $resource := "" }}
        {{ if $.Page.Resources.GetMatch $src }}
          {{ $resource = $.Page.Resources.GetMatch $src }}
        {{ else if resources.GetMatch $src }}
          {{ $resource = resources.Get $src }}
        {{ end }}
        {{ with $resource }}
          {{ $src = (.Fill "288x288").RelPermalink }}
        {{ end }}
        <img
          class="mb-2 rounded-full h-36 w-36"
          width="144"
          height="144"
          alt="{{ $.Site.Author.name | default "Author" }}"
          src="{{ $src }}"
        />
      {{ end }}
      <h1 class="text-4xl font-extrabold dark:text-white">
        {{ .Params.title | default .Site.Author.name | default .Site.Title | emojify }}
      </h1>
      {{ with .Site.Author.headline }}
        <h2 class="text-xl text-neutral-500 dark:text-neutral-400">
          {{ . | markdownify | emojify }}
        </h2>
      {{ end }}
      {{ with .Content }}
        <section class="pt-5 prose dark:prose-invert">{{ . | emojify }}</section>
      {{ end }}
    </header>
    {{ with .Site.Author.links }}
      <div class="flex flex-col flex-wrap min-w-full mt-4 sm:min-w-0">
        {{ range $links := . }}
          {{ range $type, $data := $links }}
            {{ $href := $data }}
            {{ $icon := $type }}
            {{ $text := i18n (printf "link.%s" $type) }}
            {{ $target := "_blank" }}
            {{ $title := "" }}
            {{ if reflect.IsMap $data }}
              {{ with $data.href }}{{ $href = . }}{{ end }}
              {{ with $data.icon }}{{ $icon = . }}{{ end }}
              {{ with $data.text }}{{ $text = . }}{{ end }}
              {{ with $data.target }}{{ $target = . }}{{ end }}
              {{ with $data.title }}{{ $title = . }}{{ end }}
            {{ end }}
            <a
              class="link link-{{ $type }} mb-3 min-w-full rounded py-2 text-lg sm:px-24"
              href="{{ $href }}"
              target="{{ $target }}"
              {{ with $title }}title="{{ . }}"{{ end }}
              rel="me noopener noreferrer"
            >
              {{- with $icon -}}
                <span class="mr-1">{{ partial "icon.html" . }}</span>
              {{- end -}}
              {{ $text | emojify }}
            </a>
          {{ end }}
        {{ end }}
      </div>
    {{ end }}
  </article>
{{ end }}
